/**
 * @description: 管理员权限接口参数校验
 * @version: 0.0.1
 * @author: z..
 * @Date: 2023-06-08 14:07:35
 */

import { Rule, RuleType } from '@midwayjs/validate';
import { requiredNumber, requiredString, PageDTO } from "./common";

export class InsertDTO {
  @Rule(requiredString)
  appName: string;
  @Rule(requiredString)
  callbackUrl: string;
}

export class UpdateDTO extends InsertDTO {
  @Rule(requiredNumber)
  id: number;
}

// code
export class CodeDTO {
  @Rule(requiredString)
  code: string;
}

// code
export class CodeTokenDTO {
  @Rule(requiredString)
  authCode: string;
  @Rule(requiredString)
  state: string;
}

// 分页查询
export class AdminWorkingPageDTO extends PageDTO {
  @Rule(RuleType.any())
  deptId: any;
}
// 下载文件
export class DownloadAdminWorkingFileDTO {
  @Rule(RuleType.any())
  searchKey: any;
  @Rule(RuleType.any())
  deptId: any;
}
// 更新
export class UpdateJsonConfigDataDTO{
  @Rule(requiredString)
  jsonData: string;
  @Rule(requiredNumber)
  id: number;
}
// 新增
export class InsertJsonConfigDataDTO{
  @Rule(requiredString)
  jsonData: string;
  @Rule(requiredString)
  jsonName: string;
  @Rule(requiredString)
  jsonCode: string;
}